<?php
/**
 * (commands) 解析临时表数据
 */
namespace App\Console\Commands\MonthlyReport;

use App\Logic\MonthlyReport\ParseTmp\ParseWork;
use Illuminate\Console\Command;
class PaymentParse extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'payment:parse-tmp';

    /**
     * The console command description.
     * 解析财务上传的月销售报表核算文件
     * @var string
     */
    protected $description = 'parse tmp to payment';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $model = $this->choice('choice exe item: ', ['m-ads','dsp', 'th-ads', 'vbc', 'th', 're', 'ic', 'sa','cplan', 'rebates', 'total', 'order', 'vat', 'common']);
        if($model){
            ParseWork::parse($model);
            $this->info($model.' exe success!');
        }else{
            $this->error('wrong: choice exe item!');
        }
        die('finish');
    }
}
